﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;

namespace iss.sg4210.se18.team6s.jass.reports
{
    public partial class AdvertiserTopUpAccount : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false)
            {
                ReportViewer1.Visible = false;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            DateTime startTime = Calendar1.SelectedDate;
            DateTime endTime = Calendar2.SelectedDate;


            ReportViewer1.Visible = true;


            AdvertiserAccountTopUpDataSetTableAdapters.vw_AdveriserAccountTopUpTableAdapter Ta =
               new AdvertiserAccountTopUpDataSetTableAdapters.vw_AdveriserAccountTopUpTableAdapter();


            AdvertiserAccountTopUpDataSet.vw_AdveriserAccountTopUpDataTable dt = new AdvertiserAccountTopUpDataSet.vw_AdveriserAccountTopUpDataTable();


            Ta.Fill(dt, startTime, endTime);

            System.Data.DataTable TmpDataTable = dt;

            ReportDataSource Rds = new ReportDataSource("AdvertiserAccountTopUpDataSet", TmpDataTable);
            //ReportViewer1.Reset();
            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(Rds);
            String tmpStr = Rds.ToString();

            ReportViewer1.LocalReport.Refresh();  




        }
    }
}